/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package presentacion;
import negocio.Cliente;

/**
 *
 * @author Esteban
 */
public class PanelPrincipal extends javax.swing.JPanel {

    /**
     * Singleton class
     */
    private static PanelPrincipal _Instancia;
    public PanelBusquedaUsuario _PanelBusquedaUsuario;
    public PanelBienvenida _PanelBienvenida;
    public PanelProductos _PanelProductos;
    public PanelGestionUsuarios _PanelGestionUsuarios;
    public PanelEstadosCuenta _PanelEstadosCuenta;
    
    private PanelPrincipal() {
        initComponents();
    }

    public static PanelPrincipal getInstancia(){
        if(_Instancia == null)
            _Instancia = new PanelPrincipal();
        return _Instancia;
    }
    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jSeparator1 = new javax.swing.JSeparator();
        btnMantUsuario = new javax.swing.JButton();
        btnMenu = new javax.swing.JButton();
        btnSalir = new javax.swing.JButton();
        btnBuscarUsuario = new javax.swing.JButton();
        btnEstadosCuenta = new javax.swing.JButton();
        jLabel5 = new javax.swing.JLabel();

        setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
        setMaximumSize(new java.awt.Dimension(900, 700));
        setMinimumSize(new java.awt.Dimension(900, 700));
        setPreferredSize(new java.awt.Dimension(900, 700));
        setLayout(null);
        add(jSeparator1);
        jSeparator1.setBounds(0, 80, 620, 30);

        btnMantUsuario.setFont(new java.awt.Font("Andalus", 0, 24)); // NOI18N
        btnMantUsuario.setForeground(new java.awt.Color(204, 0, 0));
        btnMantUsuario.setText("Clientes");
        btnMantUsuario.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
        btnMantUsuario.setMaximumSize(new java.awt.Dimension(300, 200));
        btnMantUsuario.setMinimumSize(new java.awt.Dimension(300, 200));
        btnMantUsuario.setPreferredSize(new java.awt.Dimension(300, 200));
        btnMantUsuario.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnMantUsuarioActionPerformed(evt);
            }
        });
        add(btnMantUsuario);
        btnMantUsuario.setBounds(60, 460, 350, 40);

        btnMenu.setFont(new java.awt.Font("Andalus", 0, 24)); // NOI18N
        btnMenu.setForeground(new java.awt.Color(204, 0, 0));
        btnMenu.setText("Menú");
        btnMenu.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
        btnMenu.setMaximumSize(new java.awt.Dimension(300, 200));
        btnMenu.setMinimumSize(new java.awt.Dimension(300, 200));
        btnMenu.setPreferredSize(new java.awt.Dimension(300, 200));
        btnMenu.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnMenuActionPerformed(evt);
            }
        });
        add(btnMenu);
        btnMenu.setBounds(60, 330, 350, 40);

        btnSalir.setFont(new java.awt.Font("Andalus", 0, 18)); // NOI18N
        btnSalir.setForeground(new java.awt.Color(204, 0, 0));
        btnSalir.setText("Salir");
        btnSalir.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
        btnSalir.setBorderPainted(false);
        btnSalir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnSalirActionPerformed(evt);
            }
        });
        add(btnSalir);
        btnSalir.setBounds(270, 590, 140, 40);

        btnBuscarUsuario.setFont(new java.awt.Font("Andalus", 0, 24)); // NOI18N
        btnBuscarUsuario.setForeground(new java.awt.Color(204, 0, 0));
        btnBuscarUsuario.setText("Nueva Orden");
        btnBuscarUsuario.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
        btnBuscarUsuario.setMaximumSize(new java.awt.Dimension(300, 200));
        btnBuscarUsuario.setMinimumSize(new java.awt.Dimension(300, 200));
        btnBuscarUsuario.setPreferredSize(new java.awt.Dimension(300, 200));
        btnBuscarUsuario.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnBuscarUsuarioActionPerformed(evt);
            }
        });
        add(btnBuscarUsuario);
        btnBuscarUsuario.setBounds(60, 210, 350, 40);

        btnEstadosCuenta.setFont(new java.awt.Font("Andalus", 0, 18)); // NOI18N
        btnEstadosCuenta.setForeground(new java.awt.Color(204, 0, 0));
        btnEstadosCuenta.setText("Estados Cuenta");
        btnEstadosCuenta.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
        btnEstadosCuenta.setBorderPainted(false);
        btnEstadosCuenta.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnEstadosCuentaActionPerformed(evt);
            }
        });
        add(btnEstadosCuenta);
        btnEstadosCuenta.setBounds(60, 590, 140, 40);

        jLabel5.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/fondoMenu.png"))); // NOI18N
        add(jLabel5);
        jLabel5.setBounds(0, 0, 900, 700);
    }// </editor-fold>//GEN-END:initComponents

    private void btnSalirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSalirActionPerformed
        _PanelBienvenida = PanelBienvenida.getInstancia();
        this.setVisible(false);
        _PanelBienvenida.setVisible(true);
    }//GEN-LAST:event_btnSalirActionPerformed

    private void btnMantUsuarioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnMantUsuarioActionPerformed
        _PanelGestionUsuarios = PanelGestionUsuarios.getInstancia();
        this.setVisible(false);
        _PanelGestionUsuarios.setVisible(true);
    }//GEN-LAST:event_btnMantUsuarioActionPerformed

    private void btnMenuActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnMenuActionPerformed
        // TODO add your handling code here:
        _PanelProductos = PanelProductos.getInstancia();
        this.setVisible(false);
        _PanelProductos.setVisible(true);
    }//GEN-LAST:event_btnMenuActionPerformed

    private void btnBuscarUsuarioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnBuscarUsuarioActionPerformed
        _PanelBusquedaUsuario = PanelBusquedaUsuario.getInstancia();
        this.setVisible(false);
        _PanelBusquedaUsuario.setVisible(true);    }//GEN-LAST:event_btnBuscarUsuarioActionPerformed

    private void btnEstadosCuentaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEstadosCuentaActionPerformed
        // TODO add your handling code here:
        _PanelEstadosCuenta = PanelEstadosCuenta.getInstance();
        this.setVisible(false);
        _PanelEstadosCuenta.cargarEstados();
        _PanelEstadosCuenta.setVisible(true);
     
    }//GEN-LAST:event_btnEstadosCuentaActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnBuscarUsuario;
    private javax.swing.JButton btnEstadosCuenta;
    private javax.swing.JButton btnMantUsuario;
    private javax.swing.JButton btnMenu;
    private javax.swing.JButton btnSalir;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JSeparator jSeparator1;
    // End of variables declaration//GEN-END:variables
}
